package com.offcn.service;

import com.offcn.dao.CourseDao;
import com.offcn.entity.Course;
import com.offcn.utils.PageTool;

import java.util.List;

public class CourseService {
    CourseDao courseDao = new CourseDao();

    public int findCourseCount(String search) {
        return courseDao.findCourseCount(search);
    }

    public List<Course> findAllCourse(PageTool pageTool, String search) {
        return courseDao.findAllCourse(pageTool, search);
    }

    public boolean addCourse(Course course) {
        return courseDao.addCourse(course) > 0;
    }

    public boolean deleteAllCourse(String deleteCourseUid) {
        return courseDao.deleteAllCourse(deleteCourseUid) > 0;
    }

    public Course selectFileName(String s) {
        return courseDao.selectFileName(s);
    }

    public boolean updateCourse(Course course) {
        return courseDao.updateCourse(course) >0;
    }

    public List<Course> findAllCourses() {
   return  courseDao.findAllCourses();
    }
}
